package com.action;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.bean.ResponseBean;
import com.service.StaffQiyeChangeRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: TZ
 * @Date: 2022.3.25 11:23:06
 * @Description:员工企业变更记录
 */
@RestController
@RequestMapping("/staffQiyeChangeRecord")
public class StaffQiyeChangeRecordAction {

    @Autowired
    private StaffQiyeChangeRecordService staffQiyeChangeRecordService;

    /**
     * 分页查询员工企业变更记录
     * @param page
     * @param limit
     * @param staffID   员工ID
     * @return
     */
    @RequestMapping("/getChangeRecord")
    public ResponseBean getChangeRecord(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit, String staffID){
        IPage iPage = staffQiyeChangeRecordService.getChangeRecord(page,limit,staffID);
        return new ResponseBean(0,iPage.getTotal(),"查询成功",iPage.getRecords());
    }
}
